﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using AcademySystem.Service.DTO;
using AcademySystem.DAL.Helpers;

namespace AcademySystem.Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IAcademySystemService
    {
        [OperationContract]
        [WebInvoke(Method = "GET",
            UriTemplate = "Cources")]
        IEnumerable<CourseDTO> GetAllCourses();

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "Cources")]
        IEnumerable<CourseDTO> GetCourses(int skip, int count);

        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "TopCources")]
        IEnumerable<CourseDTO> GetTopCourses(int count);

        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "MyCourses")]
        IEnumerable<CourseDTO> GetUserCourses(string userId);

        [OperationContract]
        [WebInvoke(Method = "POST",
            UriTemplate = "MySubscriptions")]
        IEnumerable<SubscriptionDTO> GetUserSubscriptions(string userId);

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "Authenticate")]
        AuthenticationResult Authenticate(string username, string password);

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "ToggleSubscription")]
        void ToggleSubscription(string userId, int courseId);

    }
}
